#pragma once

#include <QGLViewer/qglviewer.h>
#include <pcl/point_types.h>
#include <pcl/io/pcd_io.h>
class Particle {
public:
	Particle();

	void setData(const qglviewer::Vec& pos);
	void init();
	void draw();
	void animate();

private:
	qglviewer::Vec speed_, pos_;
	int age_, ageMax_;
};


class PointCloudViewer : public QGLViewer
{
	Q_OBJECT

public:
	PointCloudViewer(QWidget *parent = Q_NULLPTR);
	~PointCloudViewer();

	void setPointCloudData(pcl::PointCloud<pcl::PointXYZ>::Ptr& cloud);
protected:
	virtual void draw();
	virtual void init();
	virtual void animate();
	virtual QString helpString() const;

private:
	int nbPart_;
	Particle *particle_;
	pcl::PointCloud<pcl::PointXYZ>::Ptr cloud_;

	bool isRecvPointCloud_;
};
